package com.ease.platform.usersession.service;

import java.util.List;

import com.ease.actionscript.Remoting;
import com.ease.common.vo.Endpoint;
import com.ease.platform.model.type.IdentityLocation;
import com.ease.platform.model.type.IdentityUser;
import com.ease.platform.model.type.IdentityUserSession;
import com.ease.platform.usercontext.vo.UserContext;
import com.ease.platform.usersession.support.UserSessionAuthorizationException;
import com.ease.platform.usersession.vo.UserSessionContext;

public interface UserSessionManagementService {

	UserSessionContext login(String username, String password) throws UserSessionAuthorizationException;

	@Remoting(false)
	UserSessionContext login(String username, String password, Endpoint remoteEndPoint, Endpoint serverEndPoint) throws UserSessionAuthorizationException;

	@Remoting(false)
	UserSessionContext loadUserSession(long userId, Endpoint remoteEndPoint, Endpoint serverEndPoint) throws UserSessionAuthorizationException;

	@Remoting(false)
	UserSessionContext loadUserSession(String username, String password, Endpoint remoteEndPoint, Endpoint serverEndPoint) throws UserSessionAuthorizationException;

	IdentityUserSession removeUserSessionByUserSessionId(long userSessionId);

	/**
	 * 
	 * @param userContext
	 * @return
	 */
	UserContext activateUser();

	void logout();

	void resetUserContext();

	UserContext getFromCache(String key);

	int getExpireIntervalMinutes();

	IdentityUser findByContext();

	List<IdentityLocation> findMaintenanceLocationsByContext();

	@Deprecated
	/* 删除，没有需要的地方 */
	UserContext getAdminUseContext();

	@Deprecated
	/* 删除，接口部分写代理类获取并注册 integration UserContext类写 */
	UserContext getIntegrationUseContext();

	@Deprecated
	/* rename as getUserContextByUsername or getUserContextByName */
	UserContext getUserContextByUserName(String userName);
}
